﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User_center/MainContentNotHead.Master"
    AutoEventWireup="true" CodeBehind="EditMySupplyPurchase.aspx.cs" Inherits="IService.User_center.EditMySupplyPurchase" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Admin/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
    <script src="../Admin/uploadify/swfobject.js" type="text/javascript"></script>
    <script src="../Admin/uploadify/jquery.uploadify.v2.1.4.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/te/jquery-te-1.0.5.min.js" charset="utf-8"></script>
    <link type="text/css" rel="stylesheet" href="../js/te/jquery-te-Style.css" charset="utf-8" />
    <script type="text/javascript" src="../Scripts/jwplayer/jwplayer.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#fileupload1').uploadify({
                'uploader': '../Admin/uploadify/uploadify.swf',
                'script': '../Handler/UploadHandler.ashx',
                'cancelImg': '../Admin/uploadify/cancel.png',
                'folder': '../UploadFile/ProductPictures',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false,
                'sizeLimit': 1024 * 1024,
                'simUploadLimit': 5,
                'fileExt': '*.jpg;*.gif;*.png',
                'fileDesc': 'Image Files',
                onComplete: ImageComplete1,
                onError: function () { alert("图片上传失败！") }
            });
            $('#fileupload2').uploadify({
                'uploader': '../Admin/uploadify/uploadify.swf',
                'script': '../Handler/UploadHandler.ashx',
                'cancelImg': '../Admin/uploadify/cancel.png',
                'folder': '../UploadFile/ProductPictures',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false,
                'sizeLimit': 1024 * 1024,
                'simUploadLimit': 5,
                'fileExt': '*.jpg;*.gif;*.png',
                'fileDesc': 'Image Files',
                onComplete: ImageComplete2,
                onError: function () { alert("图片上传失败！") }
            });
            $('#fileupload3').uploadify({
                'uploader': '../Admin/uploadify/uploadify.swf',
                'script': '../Handler/UploadHandler.ashx',
                'cancelImg': '../Admin/uploadify/cancel.png',
                'folder': '../UploadFile/ProductPictures',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false,
                'sizeLimit': 1024 * 1024,
                'simUploadLimit': 5,
                'fileExt': '*.jpg;*.gif;*.png',
                'fileDesc': 'Image Files',
                onComplete: ImageComplete3,
                onError: function () { alert("图片上传失败！") }
            });
            $('#fileupload4').uploadify({
                'uploader': '../Admin/uploadify/uploadify.swf',
                'script': '../Handler/UploadHandler.ashx',
                'cancelImg': '../Admin/uploadify/cancel.png',
                'folder': '../UploadFile/ProductVideo',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false,
                'simUploadLimit': 5,
                'fileExt': '*.flv;*.FLV',
                'fileDesc': '请选择FLV格式视频',
                onComplete: ImageComplete4,
                onError: function () { alert("图片上传失败！") }
            });
            $('#fileupload5').uploadify({
                'uploader': '../Admin/uploadify/uploadify.swf',
                'script': '../Handler/UploadHandler.ashx',
                'cancelImg': '../Admin/uploadify/cancel.png',
                'folder': '../UploadFile/ProductVideo',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false,
                'simUploadLimit': 5,
                'fileExt': '*.flv;*.FLV',
                'fileDesc': '请选择FLV格式视频',
                onComplete: ImageComplete5,
                onError: function () { alert("图片上传失败！") }
            });
            $('#fileupload6').uploadify({
                'uploader': '../Admin/uploadify/uploadify.swf',
                'script': '../Handler/UploadHandler.ashx',
                'cancelImg': '../Admin/uploadify/cancel.png',
                'folder': '../UploadFile/ProductVideo',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false,
                'simUploadLimit': 5,
                'fileExt': '*.flv;*.FLV',
                'fileDesc': '请选择FLV格式视频',
                onComplete: ImageComplete6,
                onError: function () { alert("图片上传失败！") }
            });

            // Dialog
            $('#dialog1').dialog({
                autoOpen: false,
                width: 510,
                modal: true,
                resizable: false,
                buttons: {
                    "Ok": function () {
                        $(this).dialog("close");
                    },
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });

            // Dialog Link
            $('#openVideo1').click(function () {
                $('#dialog1').dialog('open');

                return false;
            });

            // Dialog
            $('#dialog2').dialog({
                autoOpen: false,
                width: 510,
                modal: true,
                resizable: false,
                buttons: {
                    "Ok": function () {
                        $(this).dialog("close");
                    },
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });

            // Dialog Link
            $('#openVideo2').click(function () {
                $('#dialog2').dialog('open');

                return false;
            });

            // Dialog
            $('#dialog3').dialog({
                autoOpen: false,
                width: 510,
                modal: true,
                resizable: false,
                buttons: {
                    "Ok": function () {
                        $(this).dialog("close");
                    },
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });

            // Dialog Link
            $('#openVideo3').click(function () {
                $('#dialog3').dialog('open');

                return false;
            });

            //hover states on the static widgets
            $('#dialog_link, ul#icons li').hover(
                    function () { $(this).addClass('ui-state-hover'); },
                    function () { $(this).removeClass('ui-state-hover'); }
                );
        });
        function ImageComplete1(event, ID, fileObj, response, data) {
            $("#<%=hdImgProduct1.ClientID %>").val(response);
            var obj = $("#<%=imgProduct1.ClientID %>");
            obj.show();
            obj.attr("src", response);
        }
        function ImageComplete2(event, ID, fileObj, response, data) {
            $("#<%=hdImgProduct2.ClientID %>").val(response);
            var obj = $("#<%=imgProduct2.ClientID %>");
            obj.show();
            obj.attr("src", response);
        }
        function ImageComplete3(event, ID, fileObj, response, data) {
            $("#<%=hdImgProduct3.ClientID %>").val(response);
            var obj = $("#<%=imgProduct3.ClientID %>");
            obj.show();
            obj.attr("src", response);
        }
        function ImageComplete4(event, ID, fileObj, response, data) {
            $("#<%=hdImgProduct4.ClientID %>").val(response);
            var obj = $("#<%=imgProduct4.ClientID %>");
            obj.show();
            obj.attr("src", "../images/video_view.jpg");
            video1 = response;
            jwplayer("mediaplayer1").setup({
                flashplayer: "../Scripts/jwplayer/player.swf",
                file: response,
                image: "../images/video_view.jpg"
            });
        }
        function ImageComplete5(event, ID, fileObj, response, data) {
            $("#<%=hdImgProduct5.ClientID %>").val(response);
            var obj = $("#<%=imgProduct5.ClientID %>");
            obj.show();
            obj.attr("src", "../images/video_view.jpg");
            jwplayer("mediaplayer2").setup({
                flashplayer: "../Scripts/jwplayer/player.swf",
                file: response,
                image: "../images/video_view.jpg"
            });
        }
        function ImageComplete6(event, ID, fileObj, response, data) {
            $("#<%=hdImgProduct6.ClientID %>").val(response);
            var obj = $("#<%=imgProduct6.ClientID %>");
            obj.show();
            obj.attr("src", "../images/video_view.jpg");
            jwplayer("mediaplayer3").setup({
                flashplayer: "../Scripts/jwplayer/player.swf",
                file: response,
                image: "../images/video_view.jpg"
            });
        }

        function CheckInputSupply() {
            var productName = $("#<%=txtSupplyProductName.ClientID %>").val().replace(' ', '');
            var infoTitle = $("#<%=txtSupplyInfoTitle.ClientID %>").val().replace(' ', '');

            //获取行业分类选中值     
            var strClass = "";
            var els2 = document.getElementById("<%=cblSupplyProductType.ClientID %>");
            if (els2 != null) {
                var chks2 = els2.getElementsByTagName("input");
                for (var k = 0, len = chks2.length; k < len; k++) {
                    var chk2 = chks2[k];
                    if (chk2 != null && chk2.type == 'checkbox' && chk2.checked) {
                        strClass += ',' + chk2.value;
                    }
                }
            }
            if (strClass.length > 1)
                strClass = strClass.substring(1);

            if (strClass == '') {
                alert("请选择行业分类!");
                return false;
            } else if (productName == '') {
                alert("产品名称不能为空!");
                return false;
            } else if (infoTitle == '') {
                alert("信息标题不能为空!");
                return false;
            }
        }

        function CheckInputPurchase() {
            var productName = $("#<%=txtPurchaseProductName.ClientID %>").val().replace(' ', '');
            var infoTitle = $("#<%=txtPurchaseInfoTitle.ClientID %>").val().replace(' ', '');

            //获取行业分类选中值     
            var strClass = "";
            var els2 = document.getElementById("<%=cblPurchaseProductType.ClientID %>");
            if (els2 != null) {
                var chks2 = els2.getElementsByTagName("input");
                for (var k = 0, len = chks2.length; k < len; k++) {
                    var chk2 = chks2[k];
                    if (chk2 != null && chk2.type == 'checkbox' && chk2.checked) {
                        strClass += ',' + chk2.value;
                    }
                }
            }
            if (strClass.length > 1)
                strClass = strClass.substring(1);

            if (strClass == '') {
                alert("请选择行业分类!");
                return false;
            } else if (productName == '') {
                alert("产品名称不能为空!");
                return false;
            } else if (infoTitle == '') {
                alert("信息标题不能为空!");
                return false;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="RightMainContent" runat="server">
    <div id="tab1" class="ui-tabs-panel ui-widget-content ui-corner-bottom" runat="server">
        <h3>
                    编辑求购信息</h3>
        <p>
            <label>
            需求分类:  </label>
            <asp:Label ID="lblSupplyPurchaseType" runat="server" Text=""></asp:Label></p>
        <p>
            <label>
                <span class="red">*</span>行业分类：</label>
            <span class="inputBlock">
                <asp:CheckBoxList ID="cblSupplyProductType" RepeatDirection="Horizontal" runat="server">
                    <asp:ListItem Text="内容制作" Value="内容制作"></asp:ListItem>
                    <asp:ListItem Text="制播设备" Value="制播设备"></asp:ListItem>
                    <asp:ListItem Text="传输设备" Value="传输设备"></asp:ListItem>
                    <asp:ListItem Text="系统软件" Value="系统软件"></asp:ListItem>
                    <asp:ListItem Text="专业芯片" Value="专业芯片"></asp:ListItem>
                    <asp:ListItem Text="终端产品" Value="终端产品"></asp:ListItem>
                    <asp:ListItem Text="网络运营" Value="网络运营"></asp:ListItem>
                </asp:CheckBoxList>
            </span>
        </p>
        <p>
            <label>
                <span class="red">*</span>产品名称：</label>
            <span class="inputBlock">
                <asp:TextBox ID="txtSupplyProductName" runat="server"></asp:TextBox>
            </span>
        </p>
        <h3>
            填写详细信息</h3>
        <p>
            <label>
                <span class="red">*</span>信息标题：</label>
            <span class="inputBlock">
                <asp:TextBox ID="txtSupplyInfoTitle" runat="server"></asp:TextBox>
            </span>
        </p>
        <p>
            <label>
                产品要求：</label>
            <span class="inputBlock">
                <textarea name="" id="txtareaSupplyProductDetailt" runat="server"></textarea>
            </span>
        </p>
        <p>
            <asp:Button ID="btnSupply" class="submitBtn" runat="server" Text="提交" OnClick="btnSupply_Click" />
            <span>
                <asp:Label ID="lblErrorSupply" runat="server" class="red"></asp:Label>
            </span>
        </p>
    </div>
    <div id="tab2" class="ui-tabs-panel ui-widget-content ui-corner-bottom"  runat="server">
        <h3>
            编辑供应信息</h3>
                    <p>
            <label>
            需求分类:  </label>
            <asp:Label ID="Label1" runat="server" Text=""></asp:Label></p>
        <p>
            <label>
                <span class="red">*</span>行业分类：</label>
            <span class="inputBlock">
                <asp:CheckBoxList ID="cblPurchaseProductType" RepeatDirection="Horizontal" runat="server">
                    <asp:ListItem Text="内容制作" Value="内容制作"></asp:ListItem>
                    <asp:ListItem Text="制播设备" Value="制播设备"></asp:ListItem>
                    <asp:ListItem Text="传输设备" Value="传输设备"></asp:ListItem>
                    <asp:ListItem Text="系统软件" Value="系统软件"></asp:ListItem>
                    <asp:ListItem Text="专业芯片" Value="专业芯片"></asp:ListItem>
                    <asp:ListItem Text="终端产品" Value="终端产品"></asp:ListItem>
                    <asp:ListItem Text="网络运营" Value="网络运营"></asp:ListItem>
                </asp:CheckBoxList>
            </span>
        </p>
        <p>
            <label>
                <span class="red">*</span>产品名称：</label>
            <span class="inputBlock">
                <asp:TextBox ID="txtPurchaseProductName" runat="server"></asp:TextBox>
            </span>
        </p>
        <h3>
            填写详细信息</h3>
        <p>
            <label>
                信息标题：</label>
            <span class="inputBlock">
                <asp:TextBox ID="txtPurchaseInfoTitle" runat="server"></asp:TextBox>
            </span>
        </p>
        <p>
            <label>
                产品图片：</label>
            <ul class="inputImgBlock">
                <li>
                    <asp:Image ID="imgProduct1" runat="server" ImageUrl="../images/img_upload.gif" Width="140"
                        Height="140" />
                    <asp:HiddenField ID="hdImgProduct1" runat="server" />
                </li>
                <li>
                    <asp:Image ID="imgProduct2" runat="server" ImageUrl="../images/img_upload.gif" Width="140"
                        Height="140" />
                    <asp:HiddenField ID="hdImgProduct2" runat="server" />
                </li>
                <li>
                    <asp:Image ID="imgProduct3" runat="server" ImageUrl="../images/img_upload.gif" Width="140"
                        Height="140" />
                    <asp:HiddenField ID="hdImgProduct3" runat="server" />
                </li>
            </ul>
        </p>
        <p>
            <ul class="inputImgBlock">
                <li style="width: 140px; text-align: center">
                    <input id="fileupload1" name="fileupload1" type="file" />
                </li>
                <li style="width: 140px; text-align: center">
                    <input id="fileupload2" name="fileupload2" type="file" />
                </li>
                <li style="width: 140px; text-align: center">
                    <input id="fileupload3" name="fileupload3" type="file" />
                </li>
            </ul>
        </p>
        <p>
            <ul class="inputImgBlock">
                <li style="width: 140px; text-align: center"><a href="javascript:$('#fileupload1').uploadifyUpload();">
                    上传</a> <a href="javascript:$('#fileupload1').uploadifyClearQueue();">取消</a>
                </li>
                <li style="width: 140px; text-align: center"><a href="javascript:$('#fileupload2').uploadifyUpload();">
                    上传</a> <a href="javascript:$('#fileupload2').uploadifyClearQueue();">取消</a>
                </li>
                <li style="width: 140px; text-align: center"><a href="javascript:$('#fileupload3').uploadifyUpload();">
                    上传</a> <a href="javascript:$('#fileupload3').uploadifyClearQueue();">取消</a>
                </li>
            </ul>
        </p>
        <p>
            <label>
                产品视频：</label>
                <ul class="inputImgBlock">
                    <li>
                        <a id="openVideo1" href="">
                            <asp:Image ID="imgProduct4" runat="server" ImageUrl="../images/video_upload.gif" Width="140" Height="140" />
                        </a>
                        <asp:HiddenField ID="hdImgProduct4" runat="server" />
                    </li>
                    <li>
                        <a id="openVideo2" href="">
                            <asp:Image ID="imgProduct5" runat="server" ImageUrl="../images/video_upload.gif" Width="140" Height="140" />
                        </a>
                        <asp:HiddenField ID="hdImgProduct5" runat="server" />
                    </li>
                    <li>
                        <a id="openVideo3" href="">
                            <asp:Image ID="imgProduct6" runat="server" ImageUrl="../images/video_upload.gif" Width="140" Height="140" />
                        </a>
                        <asp:HiddenField ID="hdImgProduct6" runat="server" />
                    </li>
                </ul>
        </p>
        <p>
            <ul class="inputImgBlock">
                <li style="width: 140px; text-align: center">
                    <input id="fileupload4" name="fileupload4" type="file" />
                </li>
                <li style="width: 140px; text-align: center">
                    <input id="fileupload5" name="fileupload5" type="file" />
                </li>
                <li style="width: 140px; text-align: center">
                    <input id="fileupload6" name="fileupload6" type="file" />
                </li>
            </ul>
        </p>
        <p>
            <ul class="inputImgBlock">
                <li style="width: 140px; text-align: center"><a href="javascript:$('#fileupload4').uploadifyUpload();">
                    上传</a> <a href="javascript:$('#fileupload4').uploadifyClearQueue();">取消</a>
                </li>
                <li style="width: 140px; text-align: center"><a href="javascript:$('#fileupload5').uploadifyUpload();">
                    上传</a> <a href="javascript:$('#fileupload5').uploadifyClearQueue();">取消</a>
                </li>
                <li style="width: 140px; text-align: center"><a href="javascript:$('#fileupload6').uploadifyUpload();">
                    上传</a> <a href="javascript:$('#fileupload6').uploadifyClearQueue();">取消</a>
                </li>
            </ul>
        </p>
        <p>
            <label>
                详细说明：</label>
            <span class="inputBlock">
                <textarea id="txtareaPurchaseProductDetail" runat="server"></textarea>
            </span>
        </p>
        <p>
            <asp:Button ID="btnPurchase" class="submitBtn" runat="server" Text="提交" OnClick="btnPurchase_Click" />
            <span>
                <asp:Label ID="lblErrorPurchase" runat="server" class="red"></asp:Label></span>
        </p>
    </div>
    <!-- ui-dialog -->
    <div id="dialog1" title="Watch the wonderful review">
        <div class="flashVideo" style="height: 360px; width: 480px; position: relative;">
            <object height="100%" width="100%" type="application/x-shockwave-flash" data="jwplayer/player.swf"
                bgcolor="#000000" id="mediaplayer1" name="mediaplayer" tabindex="0">
                <param name="allowfullscreen" value="true">
                <param name="allowscriptaccess" value="always">
                <param name="seamlesstabbing" value="false">
                <param name="wmode" value="opaque">
                <param name="flashvars" value="netstreambasepath=file%3A%2F%2F%2FC%3A%2FUsers%2Fninjaisun%2FDownloads%2Fmediaplayer-viral%2Fmediaplayer-5.9-viral%2Freadme.html&amp;id=mediaplayer&amp;file=video.mp4&amp;image=preview.jpg&amp;controlbar.position=over">
            </object>
            <script type="text/javascript">
                jwplayer("mediaplayer1").setup({
                    flashplayer: "../Scripts/jwplayer/player.swf",
                    file: "../<%=VideoList["Video1"]%>",
                    image: "../images/video_view.jpg"
                });
            </script>
        </div>
    </div>
    <!-- ui-dialog -->
    <div id="dialog2" title="Watch the wonderful review">
        <div class="flashVideo" style="height: 360px; width: 480px; position: relative;">
            <object height="100%" width="100%" type="application/x-shockwave-flash" data="jwplayer/player.swf"
                bgcolor="#000000" id="mediaplayer2" name="mediaplayer" tabindex="0">
                <param name="allowfullscreen" value="true">
                <param name="allowscriptaccess" value="always">
                <param name="seamlesstabbing" value="false">
                <param name="wmode" value="opaque">
                <param name="flashvars" value="netstreambasepath=file%3A%2F%2F%2FC%3A%2FUsers%2Fninjaisun%2FDownloads%2Fmediaplayer-viral%2Fmediaplayer-5.9-viral%2Freadme.html&amp;id=mediaplayer&amp;file=video.mp4&amp;image=preview.jpg&amp;controlbar.position=over">
            </object>
            <script type="text/javascript">
                jwplayer("mediaplayer2").setup({
                    flashplayer: "../Scripts/jwplayer/player.swf",
                    file: "../<%=VideoList["Video2"]%>",
                    image: "../images/video_view.jpg"
                });
            </script>
        </div>
    </div>
    <!-- ui-dialog -->
    <div id="dialog3" title="Watch the wonderful review">
        <div class="flashVideo" style="height: 360px; width: 480px; position: relative;">
            <object height="100%" width="100%" type="application/x-shockwave-flash" data="jwplayer/player.swf"
                bgcolor="#000000" id="mediaplayer3" name="mediaplayer" tabindex="0">
                <param name="allowfullscreen" value="true">
                <param name="allowscriptaccess" value="always">
                <param name="seamlesstabbing" value="false">
                <param name="wmode" value="opaque">
                <param name="flashvars" value="netstreambasepath=file%3A%2F%2F%2FC%3A%2FUsers%2Fninjaisun%2FDownloads%2Fmediaplayer-viral%2Fmediaplayer-5.9-viral%2Freadme.html&amp;id=mediaplayer&amp;file=video.mp4&amp;image=preview.jpg&amp;controlbar.position=over">
            </object>
            <script type="text/javascript">
                jwplayer("mediaplayer3").setup({
                    flashplayer: "../Scripts/jwplayer/player.swf",
                    file: "../<%=VideoList["Video3"]%>",
                    image: "../images/video_view.jpg"
                });
            </script>
        </div>
    </div>

</asp:Content>
